<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<img src="../image/a1.png" height="60" width="80" />
		<img src="../image/a2.png" height="60" width="80" />
		<img src="../image/a3.png" height="60" width="80" />
		<img src="../image/a4.png" height="60" width="80" />
		<img src="../image/a5.png" height="60" width="80" />
	</body>
</html>

<script src="../../JQ/jquery-3.5.1.min.js"></script>
<script>
	$(function(){
		$("img").each(function(index){
			$(this).attr("title","第"+(index+1)+"张照片");
		})
	})
</script>
<!--
each()方法遍历元素
each(callback)
callback是一个函数，可以接受形参index,遍历元素的序号， 从0开始。


-->